package com.example.teesystem.entityDto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.example.teesystem.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

/**
 * @author pxr
 * @data 13/2/2023 下午8:48
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RadarEvaluate implements Comparable<RadarEvaluate>{
    /**
     * 记忆型
     */
    private Double memory;
    /**
     * 理解型
     */
    private Double understand;
    /**
     * 应用型
     */
    private Double application;
    /**
     * 逻辑型
     */
    private Double logic;
    /**
     * 概念型
     */
    private Double concept;
    /**
     * 综合型
     */
    private Double comprehensive;

    private Double percent;

    int uid;

    public RadarEvaluate(double memory,double understand,double application,double logic,double concept,double comprehensive,int uid){
        this.application =application;
        this.memory = memory;
        this.understand = understand;
        this.logic = logic;
        this.comprehensive = comprehensive;
        this.concept = concept;
        this.uid = uid;

        this.percent = (this.application+this.memory+this.understand+this.logic+this.comprehensive+this.concept)/6;
    }

    @Override
    public int compareTo(@NotNull RadarEvaluate o) {
        if(o.getPercent()>this.getPercent()) {
            return 1;
        } else if(o.getPercent()<this.getPercent()) {
            return -1;
        }
        return 0;
    }
}
